-
Notifications
You must be signed in to change notification settings - Fork 794
feat(ethers-contract): Make ethers-providers optional #2536
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Content from ethers-contract/src/multicall/mod.rs
was moved here. Nothing else was changed.
ethers-contract/src/event_core.rs
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Content from ethers-contract/src/event.rs
was moved here. Nothing else was changed.
The tests that are failing are not related to my changes and they failing before the changes on my machine. |
I found that foundry was responsible for the test failures. The tests are passing with version |
e249352
to
3740d34
Compare
With the latest foundry nightly the tests passed, so this PR is ready. Any comments are welcome. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is great! Just a few things
Motivation
I'm working in a very restricted WASM environment (see #2532), which I can not use
ethers-providers
crate. However I would like to useethers_contract::EthCall
derive functions.Solution
With this PR, I introduced the
providers
flag inethers-contract
,ethers-contract-abigen
, andethers-contract-derive
. Anything related toethers-providers
is now enabled with the flag.providers
flag was added in the default features ofethers-contract
.If a user adds
ethers
orethers-middleware
crates, thenproviders
is always enabled, even if user disabled the default flags. This is because they haveethers-providers
as a dependency and there is no reason to make the flag optional.If a user adds
ethers-contract
and disables default features, then they need to addproviders
feature to get the same functionality as before. - Is this edge case a major breaking change?If you have any other ideas how this can be better, let me know.
PR Checklist